package lottery.office;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;

public class LotteryDatabase {
	public void writeDrawing(String drawingStr) {
		try {
			File drawingFile = new File("drawings.txt");
			FileWriter fr = new FileWriter(drawingFile, true);
			BufferedWriter br = new BufferedWriter(fr);

			br.write(drawingStr);

			br.close();
		} catch (Exception e) {
			System.out.println("Eksepszyn");
		}
	}

	public void readDrawing() {
		try {
			File file = new File("drawings.txt");
			FileReader fr = new FileReader(file);
			BufferedReader br = new BufferedReader(fr);
			
			String row = null;
			
			while ((row = br.readLine()) != null){
				System.out.println(row);
			}
			
			br.close();
			
		} catch (Exception e) {
			System.out.println("Eksepszyn");
		}
	}
}
